package com.xayy.mgt.model;

import cn.kawins.mybatis.base.BaseModel;
import cn.kawins.mybatis.interceptor.FillingCreateTime;
import cn.kawins.mybatis.interceptor.InsertAutoFilling;
import cn.kawins.mybatis.interceptor.UpdateAutoFilling;
import cn.kawins.mybatis.util.SnowflakeId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

import lombok.*;

/**
 * 单星健康态势表信息
 * 
 * @author Nie
 * @version V1.0
 * @date 2023/8/17 11:42
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "health_xw.health_situation_info")
@EqualsAndHashCode(callSuper = true)
public class HealthSituation extends BaseModel<Long> {

    @Id
    @ApiModelProperty(value = "主键")
    @Column(name = "id")
    @KeySql(genId = SnowflakeId.class)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 节点id
     */
    @ApiModelProperty(value = "节点id")
    @Column(name = "node_id")
    private Long nodeId;
    /**
     * 指标id
     */
    @ApiModelProperty(value = "指标id")
    @Column(name = "metrics_id")
    private Long metricsId;

    /**
     * 指标名称
     */
    @ApiModelProperty(value = "指标名称")
    @Column(name = "metrics_name")
    private String metricsName;

    /**
     * 指标名称
     */
    @ApiModelProperty(value = "指标类型1：功能项指标2：性能项指标3：健康度指标")
    @Column(name = "metrics_type")
    private Integer metricsType;

    /**
     * x轴时间
     */
    @ApiModelProperty(value = "x轴时间")
    @Column(name = "time_info")
    private Date timeInfo;

    /**
     * y轴数据
     */
    @ApiModelProperty(value = "y轴数据")
    @Column(name = "data_info")
    private String dataInfo;

    /**
     * 创建时间
     */
    @Column(name = "created_time")
    @InsertAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "创建时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY,
        example = "2010-01-01 00:00:00")
    private Date createdTime;
    /**
     * 更新时间
     */
    @Column(name = "updated_time")
    @UpdateAutoFilling(value = FillingCreateTime.class)
    @ApiModelProperty(value = "最后更新时间", accessMode = ApiModelProperty.AccessMode.READ_ONLY,
        example = "2010-01-01 00:00:00")
    private Date updatedTime;

    @Override
    public Long idValue() {
        return id;
    }
}
